Many methods for the lossless compression of discrete signals exist. The minimum-redundancy Huffman compression method, for example, is useful when the set of distinct possible input signals is small enough to allow use of a convenient "codebook" and the statistical distribution of the input signals is known in advance. D. A. Huffman, "A Method for the Construction of Minimum Redundancy Codes", Proc. IRE, 40:1098-1101 (1952) and T. M. Cover and J. A. Thomas, Elements of Information Theory, pp.92-101 (1991). Huffman does not, however, teach a method for compression in situation where the codebook becomes unmanageably large (because of the large number of possible input signals) or when the statistical distribution of the input signals is not known in advance (in which case the codebook cannot be composed to provide efficient encoding).
Another method, taugh by Lempel and Ziv, does not require that the statistical distribution of the input signals be known in advance, but requires more computation and memory than may be desirable for some applications. J. Ziv and A. Lempel, "A Universal Algorithm for Sequential Data Compression," IEEE Trans. Info. Theory, IT-23, 337-343 (1977).
Yet another method, taught by Bentley and Yao and also by Elias, provides for compressing signals of arbitrary magnitude by forming compressed signals which comprises a variable length header and a variable length payload. The header is uniquely decodable and represents the length of the payload. The payload represents the uncompressed signal. J. L. Bentley and A. C. Yao, "An Almost Optimal Algorithm for Unbounded Searching," Info. Proc. Letters, Vol. 5, No. 3, 82-87 Aug. 1976); J. L. Bentley et al, U.S. Pat. No. 4,796,003, issued Jan. 3, 1989; P. Elias, "Universal Codeword Sets and Representations of the Integers," IEEE Trans. Info. Theory, Vol. IT-21, No. 2, 194-203 Mar. 1975).